Communication apparatus, communication method, and storage medium

ABSTRACT

A communication apparatus acquires information about a communication-parameter setting process from a different communication apparatus and determines whether the acquired information includes identification information for identifying the different communication apparatus. If it is determined that the identification information is included, an authentication request is transmitted by unicast based on the identification information. If it is determined that the identification information is not included, the authentication request is transmitted by broadcast.

BACKGROUND

Field

Aspects of the present invention generally relate to communicationtechnology.

Description of the Related Art

Recently, it has been observed that electronic devices, such as adigital camera, a printer, a cellular phone, smartphones, etc., areprovided with a wireless communication function enabling them to connectto wireless networks. In particular, these devices are using theirwireless communication functions to communicate with each other via awireless local-area network (LAN).

To connect electronic devices to a wireless network, it is necessary toset various communication parameters, such as an encryption method, anencryption key, an authentication method, an authentication key, etc. Asa technique for facilitating setting of these communication parameters,it has been proposed that a mobile terminal read a quick response (QR)Code® that indicates communication parameters and that is displayed byan electronic device, and set the read communication parameters to anaccess point (see Japanese Patent Laid-Open No. 2014-60623).

As described in Japanese Patent Laid-Open No. 2014-60623, capturing ofan image of code information such as a two-dimensional code in which alarge amount of information is encoded triggers setting of communicationparameters. This alleviates troublesome input operations performed by auser. In Japanese Patent Laid-Open No. 2014-60623, a method is describedin which a QR Code® including identification information for identifyinga device presenting the QR Code® is displayed, and in which a devicephotographing the QR Code® specifies a target device to whichcommunication parameters are to be set.

Identification information with which a device is identified can bedynamically changed. For example, an administrator or the like canrewrite a MAC address in a wireless LAN when necessary. In Wi-FiDirect®, there are two types of identification information of a device,the P2P device address and P2P interface address. In Wi-Fi Direct®,protocol processing is performed to form a wireless network (P2P group).When a P2P group is to be formed, the P2P interface address is used toidentify a device. After a P2P group is formed, the P2P interfaceaddress is used to identify a device in communication in the P2P group.Any value can be set to the P2P device address and P2P interface addressin a device, and different values can be dynamically set to the P2Pdevice address and P2P interface address.

When identification information of a device is thus allowed to bedynamically changed, a device capable of displaying a QR Code® for whichinformation is dynamically changed can display its identificationinformation that has been changed as appropriate. However, when a QRCode® is displayed on a label or the like, it is not possible todynamically change information indicated by the QR Code®. Therefore,under such circumstances, it is not possible for a QR Code® to includeinformation for identifying a device.

SUMMARY

Aspects of the present invention provide a communication apparatus thatperforms a communication-parameter setting process efficiently inaccordance with whether identification information of an apparatus withwhich the communication-parameter setting process is to be performed hasbeen obtained.

According to an aspect of the present invention, a communicationapparatus includes an acquiring unit, a determination unit, and atransmitting unit. The acquiring unit acquires, from a differentcommunication apparatus, information about a communication-parametersetting process. The determination unit determines whether the acquiredinformation includes identification information for identifying thedifferent communication apparatus. The transmitting unit transmits, whenan authentication request used in an authentication process performed inthe communication-parameter setting process is to be transmitted, if thedetermination unit determines that the identification information isincluded, the authentication request by unicast based on theidentification information and by broadcast if the determination unitdetermines that the identification information is not included.

Further features of aspects of the present invention will becomeapparent from the following description of exemplary embodiments withreference to the attached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram illustrating an exemplary configuration of acommunication system.

FIG. 2 is a diagram illustrating the configuration of a smartphone.

FIG. 3 is a diagram illustrating the configuration of an access point(AP) and a printer.

FIG. 4 is a diagram illustrating an exemplary operational sequence ofthe communication system.

FIG. 5 is a flowchart of an exemplary operation performed by thesmartphone.

FIG. 6 is a flowchart of an exemplary operation performed by thesmartphone.

DESCRIPTION OF THE EMBODIMENTS

FIG. 1 illustrates the configuration of a communication system accordingto the present embodiment. FIG. 1 illustrates a smartphone 101 and anaccess point (hereinafter referred to as an AP) 102 that is a basestation. FIG. 1 also illustrates a printer 103 and a wireless network104 formed among the apparatuses in the communication system. In thepresent embodiment, the wireless network 104 illustrated in FIG. 1 is awireless local-area network (LAN) based on the IEEE (The Institute ofElectrical and Electronics Engineers, Inc.) 802.11 series. The wirelessnetwork 104 is also a wireless network formed by the AP 102. However,the configuration in which apparatuses communicate with one another isnot necessarily limited to a wireless LAN based on IEEE 802.11.

In the description below, a case in which a parameter setting processfor establishing a wireless LAN connection between the AP 102 and theprinter 103 is performed via the smartphone 101 will be described.

Communication parameters include various wireless communicationparameters for performing wireless communication based on the IEEE802.11 standard. That is, the communication parameters include wirelesscommunication parameters necessary to perform wireless LANcommunication, such as a service set identifier (SSID) serving as anetwork identifier, an encryption method, an encryption key, anauthentication method, and an authentication key. The communicationparameters can also include an Internet Protocol (IP) address forperforming communication in the IP layer. In the present embodiment, thesmartphone 101, the AP 102, and the printer 103 are provided with awireless LAN communication function.

In the present embodiment, the communication-parameter setting processis first performed between the smartphone 101 and the AP 102. In thisprocess, the smartphone 101 sets communication parameters forconstructing the wireless network 104, to the AP 102. By usingcommunication parameters obtained from the smartphone 101, the AP 102constructs the wireless network 104. Subsequently, thecommunication-parameter setting process is performed between thesmartphone 101 and the printer 103. In this process, the smartphone 101provides communication parameters to the printer 103. By using theobtained communication parameters, the printer 103 establishes aconnection with the wireless network 104 constructed by the AP 102. Adescription will be made by taking a smartphone, a printer, and an AP asexemplary communication apparatuses in the communication systemaccording to the present embodiment. Instead, for example, othercommunication apparatuses, such as a digital camera, a video camera, asmartwatch, a personal digital assistant (PDA), various digitalhousehold appliances, can be used. The AP can be a communicationapparatus, such as a smartphone, a printer, or a digital camera, whichis provided with an AP function.

The hardware configuration of a communication apparatus according to thepresent embodiment will be described by using FIG. 2. FIG. 2 illustratesthe entire smartphone 101. An image capturing unit 201 includes acharge-coupled device (CCD) and a lens. The image capturing unit 201captures an image and a movie. For example, the image capturing unit 201photographs and reads code information, such as a bar code, atwo-dimensional code, or a quick response (QR) code. An image processor202 performs image processing on an image or the like captured by theimage capturing unit 201. The image processor 202 decodes and analyzesthe code information such as a QR Code®, as described below. The imageprocessor 202 analyzes an image captured by the image capturing unit201, and decodes encoded information so as to obtain the decodedinformation.

An operation unit 203 is used to operate the smartphone 101, andincludes operation buttons. The operation unit 203 stores a flagcorresponding to an input, in a memory such as a storage unit 207. Adisplay unit 204 is provided with a function of outputting at least oneof visual information and sound information. In the case where thedisplay unit 204 displays visual information, the display unit 204includes a video random-access memory (VRAM) for storing image datacorresponding to visual information that is to be displayed. The displayunit 204 performs display control so that image data stored in the VRAMis continuously displayed on a liquid crystal display (LCD) or alight-emitting diode (LED). A power supply unit 205 supplies power tothe pieces of hardware in the smartphone 101. The power supply unit 205is constituted, for example, by a battery.

A controller 206 executes control programs stored in the storage unit207 so as to control the entire smartphone 101. Various operationsdescribed below are performed in such a manner that the controller 206executes the control programs stored in the storage unit 207. Thecontroller 206 is constituted, for example, by a central processing unit(CPU). The storage unit 207 stores various information, such as thecontrol programs executed by the controller 206, and information about acommunication target apparatus. The storage unit 207 is constituted, forexample, by a storage medium, such as a hard disk drive (HDD), a flashmemory, a removable secure digital (SD) card, a read-only memory (ROM),or a random-access memory (RAM).

An antenna 208 is capable of performing communication in a 2.4 GHz bandand/or a 5 GHz band for wireless communication using a wireless LAN. Acommunication unit 209 is used to perform wireless communication using awireless LAN based on the IEEE 802.11 series. In addition, protocolprocessing based on Wi-Fi Direct® defined by Wi-Fi Alliance® can beperformed. The communication unit 209 is made up of a chip performingwireless communication.

Functions that are stored as programs in the storage unit 207 of thesmartphone 101 and that are achieved by the controller 206 executing theprograms will be described. The functions described below are achievedin such a manner that, according to the control programs, the controller206 controls pieces of hardware, and computes and processes information.

The smartphone 101 performs a communication-parameter setting process ofsetting communication parameters to a peer apparatus. In thecommunication-parameter setting process, a providing apparatus providescommunication parameters used in wireless communication, to a receivingapparatus. In the present embodiment, a case in which the smartphone 101operates as the providing apparatus, and in which a peer apparatus (forexample, the AP 102 or the printer 103) operates as the receivingapparatus will be described. However, this is not limiting. When thepeer apparatus already has communication parameters, the smartphone 101can obtain the communication parameters from the peer apparatus.

The communication-parameter setting process according to the presentembodiment will be described below. The smartphone 101 photographs a QRCode® that is displayed on a different apparatus or that is associatedwith the different apparatus. The QR Code® associated with a differentapparatus is, for example, a QR Code® attached on the case of thedifferent apparatus or a QR Code® described in an instruction manual ofthe different apparatus.

The smartphone 101 obtains information that is included in the read QRcode and that is necessary to perform the communication-parametersetting process. The information necessary to perform thecommunication-parameter setting process is, for example, communicationparameters themselves, or information used in thecommunication-parameter setting process. Information used when thesmartphone 101 searches for the apparatus presenting the QR Code® can beincluded. An example of information used in the searching isidentification information for identifying the apparatus presenting theQR Code®. The identification information of an apparatus is a mediaaccess control (MAC) address, a universally unique identifier (UUID), orthe like for uniquely identifying a network device. In the case ofparameter setting in Wi-Fi Direct®, a P2P device address or a P2Pinterface address can be used. Further, channel information of awireless LAN can be included as one piece of information used in thesearching. Inclusion of channel information of a wireless LAN enablesthe smartphone 101 to search for the apparatus presenting the QR Code®by using only a predetermined channel, achieving a reduction in theprocessing time for the searching.

The smartphone 101 transmits a search signal to one or more peerapparatuses to perform the communication-parameter setting process witha peer apparatus based on the information obtained from the QR code, andsearches for the peer apparatus with which the communication-parametersetting process is to be performed.

In the present embodiment, the smartphone 101 performs an authenticationprocess with the peer apparatus. This process is an authenticationprocess for identifying whether the peer apparatus is a valid partnerwith which the communication-parameter setting process is to beperformed. In the authentication process, information included in the QRcode can be used to perform authentication between the apparatuses.Instead, a hash value of the information included in the QR code can becalculated, and can be used as authentication information. In thepresent embodiment, information used when communication parameters areencrypted and transmitted is also shared between the smartphone 101 andthe peer apparatus in the authentication process.

In the present embodiment, a case in which the search signal forperforming the communication-parameter setting process is used as asignal for an authentication request in the authentication process willbe described. However, this is not limiting. For example, the signal forperforming the communication-parameter setting process can be a searchsignal such as a probe request based on the IEEE 802.11 standard. Thisis not limited to a probe request, and an action frame or the like forsearching for a target communication apparatus can be used.

A secure wireless link between the smartphone 101 and the peer apparatuscan be established, and the wireless link can be used to perform theauthentication process and the communication-parameter setting process.Alternatively, a predetermined frame such as an action frame in awireless LAN can be used to perform the authentication process and thecommunication-parameter setting process. At that time, an action frameitself may be encrypted. For example, the encryption may be performed onthe basis of information about any common string that is set in theapparatuses.

When the smartphone 101 detects the peer apparatus and successfullyperforms the authentication process, the smartphone 101 encryptscommunication parameters and sets the communication parameters to thepeer apparatus through wireless communication. In thecommunication-parameter setting process, a public key can be used toperform encryption and encrypted information can be communicated. Thepublic key can be included in the QR Code®. As a method of using apublic key to encrypt communication parameters, a method disclosed inJapanese Patent Laid-Open No. 2014-230152 can be used.

In the present embodiment, a case in which information necessary toperform the communication-parameter setting process is obtained from aQR Code® will be described. However, this is not limiting.Alternatively, such information can be obtained through short rangewireless communication such as near field communication (NFC). Instead,information can be transferred by using wireless communication otherthan wireless LAN communication, such as Bluetooth®. Further, wirelesscommunication, such as IEEE 802.11ad or TransferJet®, can be used.

Instead, both of the apparatuses can transfer information necessary toset communication parameters, to each other in advance. For example, asecure link, an action frame, or the like can be used to obtaininformation about the peer apparatus. At that time, an action frameitself can be encrypted. For example, the encryption can be performed onthe basis of information about any common string that is set in theapparatuses. At that time, the smartphone 101 and the peer apparatus canexchange information about the apparatuses with each other.

The smartphone 101 can register information about a peer apparatus towhich communication parameters are to be set. An apparatus to beregistered can be an apparatus with which communication parameters havebeen shared before, or an apparatus to which a connection can beestablished through a secure link. Information about a peer apparatus tobe registered can be obtained from a QR Code®. Alternatively,information about a peer apparatus to be registered can be informationabout a wireless network, such as an SSID used when wirelesscommunication was performed with the peer apparatus the last time.

The configuration of an AP 102 and the printer 103 will be described byusing FIG. 3. In FIG. 3, a functional unit 301 of the AP 102 is acontrol processor for operating as a wireless LAN base station. Thefunctional unit 301 also includes hardware for performing functions of afunctional unit. In the printer 103, the functional unit 301 is a printunit, and performs a print process. An operation unit 302 is a unit foroperating the AP 102 or the printer 103, and includes operation buttons.The operation unit 302 stores a flag corresponding to an input, in amemory such as a storage unit 306. A display unit 303 is provided with afunction of outputting at least one of visual information and soundinformation. When the display unit 303 displays visual information, thedisplay unit 303 includes a VRAM for storing image data corresponding tovisual information that is to be displayed. The display unit 303performs display control so that image data stored in the VRAM iscontinuously displayed on an LCD or an LED. A power supply unit 304supplies power to pieces of hardware of the AP 102 or the printer 103.The power supply unit 304 is constituted, for example, by a battery oran alternating current (AC) adaptor power supply.

A controller 305 controls the entire AP 102 or the entire printer 103 byexecuting control programs stored in the storage unit 306. Thecontroller 305 executes the control programs stored in the storage unit306, whereby various operations described below are performed. Thecontroller 305 is constituted, for example, by a CPU. The storage unit306 stores various types of information, such as the control programsexecuted by the controller 305, and information about a communicationtarget apparatus. The storage unit 306 is constituted, for example, by astorage medium, such as an HDD, a flash memory, a removable SD card, aROM, or a RAM.

An antenna 307 is capable of performing communication in a 2.4 GHz bandand/or a 5 GHz band for wireless LAN communication. A communication unit308 is a unit for performing wireless LAN communication based on theIEEE 802.11 series. The communication unit 308 is made up of a chipperforming wireless communication.

Functions that are stored as programs in the storage unit 306 of the AP102 or the printer 103 and that are achieved by the controller 305executing the programs will be described. The functions described beloware achieved in such a manner that, according to the control programs,the controller 305 controls pieces of hardware, and computes andprocesses information.

The AP 102 and the printer 103 are capable of performing thecommunication-parameter setting process in which communicationparameters are shared between apparatuses. The AP 102 operates as anaccess point defined in IEEE 802.11, in communication performed by thecommunication unit 308. The printer 103 operates as a station defined inIEEE 802.11, in communication performed by the communication unit 308.

The printer 103 can generate a QR Code® including information necessaryfor the communication-parameter setting process. The generated QR Code®is displayed by the display unit 303 on an LCD or the like.Alternatively, the QR Code® can be printed in a print process performedby the functional unit 301.

The information necessary for the communication-parameter settingprocess is, for example, communication parameters themselves orinformation used in protocol processing for the communication-parametersetting process. Other than these, information necessary to setcommunication parameters is similar to that for the smartphone 101described above, and no description will be made.

In the present embodiment, the QR Code® for the AP 102 is attached tothe case as a label. Assume that the MAC address of the AP 102 can berewritten under administrator authority, and that the QR Code® does notinclude the MAC address as identification information of the AP 102. Inthe present embodiment, assume that the QR Code® for the AP 102 does notinclude channel information. In the present embodiment, assume that theprinter 103 is capable of dynamically displaying the QR Code® on thedisplay unit 303. It is also assumed that the printer 103 is a devicefor which an administrator or the like can rewrite the MAC address ofthe printer 103 when necessary. When the printer 103 receives aninstruction to start the communication-parameter setting process, theprinter 103 displays a QR Code® obtained by encoding informationincluding the MAC address that is being used when the instruction isreceived. Similarly, when the printer 103 receives an instruction tostart the communication-parameter setting process, the printer 103enters a state of waiting for an authentication request in thecommunication-parameter setting process in a fixed channel. The QR Code®for the printer 103 includes channel information as well as the MACaddress. A MAC address is such an address that it is not possible forthe same address to be assigned to multiple network devices in aduplicate manner. Therefore, in rewriting of a MAC address, when theprocesses described below are to be performed, the apparatuses can beset to the administrator mode in which only an administrator can performan operation or the service mode in which only a serviceman can performan operation, by using the IDs or the like. At that time, a checkprocess can be added so that a MAC address to be set is not set tomultiple apparatuses in a duplicate manner.

Operations performed by the communication system having theabove-described configuration will be described. A case in which thesmartphone 101 is used to perform the communication-parameter settingprocess with each of the AP 102 and the printer 103 in order thatwireless LAN communication between the AP 102 and the printer 103 isperformed will be described.

A sequence chart for the communication system will be described by usingFIG. 4. In the sequence chart in FIG. 4, a case in which the smartphone101 is used to establish a wireless LAN connection between the AP 102and the printer 103 will be described. In FIG. 4, the smartphone 101first photographs the QR Code® prepared for the AP 102, and performs theparameter setting process with the AP 102. The AP 102 uses communicationparameters obtained from the smartphone 101, so as to construct thewireless network 104. Subsequently, the smartphone 101 photographs theQR Code® prepared for the printer 103, and connects the printer 103 tothe wireless network 104.

First, the smartphone 101 receives an instruction to start thecommunication-parameter setting process. When an instruction to startthe communication-parameter setting process is received, a message suchas “Photograph the QR Code® prepared for an AP” can be displayed on thedisplay unit 204 of the smartphone 101. When the smartphone 101 receivesan instruction to start the communication-parameter setting process, thesmartphone 101 activates the image capturing unit 201 (F401). Then, thesmartphone 101 photographs a QR Code® attached to the case of the AP 102(F402).

After the photographing operation, the smartphone 101 transmits anauthentication request to the AP 102 on the basis of informationincluded in the QR Code® (F403). In the process in FIG. 5, which isdescribed below, it is determined whether the authentication request isto be transmitted by unicast, broadcast or multicast and whether theauthentication request is to be transmitted in a specific channel or allchannels, based on the information included in the QR Code®.Transmission in all channels means that an authentication request issequentially transmitted by switching among multiple channels availablefor the smartphone 101 in time-division manner. The process will bedescribed below in detail. In this example, the authentication requestis transmitted from the smartphone 101 to the AP 102 by broadcast in allchannels. As described above, the authentication request includingvarious types of information based on the information included in theobtained QR Code® is transmitted. When the AP 102 receives theauthentication request, the AP 102 compares the authentication requestwith the information included in the QR Code® prepared for the AP 102,performs the authentication process, and transmits the authenticationresult as an authentication response to the smartphone 101 (F404).

When the authentication response is transmitted from the AP 102 and isreceived by the smartphone 101, the smartphone 101 analyzes theauthentication result. When the authentication result indicatesauthentication success, information for encrypting communicationparameters that are to be transferred between the smartphone 101 and theAP 102 can be shared between both of the apparatuses. When necessary,after the authentication response is received by the smartphone 101,information necessary for encryption can be transmitted from thesmartphone 101 to the AP 102 again.

After the authentication process, the communication-parameter settingprocess is performed between the smartphone 101 and the AP 102, andcommunication parameters are transferred from the smartphone 101 to theAP 102 (F405). In the communication-parameter setting process, thecommunication parameters are encrypted in the smartphone 101 and the AP102 based on the encrypting information shared in the authenticationprocess, and the encrypted communication parameters are communicated. Inthe present embodiment, an authentication request, an authenticationresponse, and various messages received/transmitted in thecommunication-parameter setting process are implemented by using anaction frame used in a wireless LAN based on the IEEE 802.11 standard.Assume that the AP 102 is also capable of receiving/transmitting anaction frame.

Upon completion of the communication-parameter setting process performedbetween the smartphone 101 and the AP 102, the AP 102 uses thecommunication parameters provided from the smartphone 101, so as to formthe wireless network 104. When the AP 102 has already formed a wirelessnetwork by using different communication parameters, the AP 102 forms awireless network again by using the communication parameters providedfrom the smartphone 101.

Subsequently, a user instructs the printer 103 to start thecommunication-parameter setting process. When the printer 103 receivesan instruction to start the communication-parameter setting process, theprinter 103 displays, on the display unit 303, a QR Code® obtained byencrypting information that includes the MAC address of the printer 103that is being used at that time, and that also includes channelinformation for setting communication parameters (F406). The printer 103enters a state of waiting for reception of an authentication requestfrom a peer apparatus, in a channel for setting parameters.

The smartphone 101 photographs the QR Code® displayed on the displayunit 303 of the printer 103, thereby obtaining information about theprinter 103 (F407). After completion of the communication-parametersetting process performed with the AP 102, the smartphone 101 canautomatically enter a state of being ready to photograph a QR Code®, or,by receiving again an instruction to start the communication-parametersetting process from a user, can enter a state of being ready tophotograph a QR Code®. In the smartphone 101, photographing of a QRCode® prepared for the AP 102 can be followed by the followingoperations in sequence: photographing of the QR Code® prepared for theprinter 103; authentication with the AP 102 and parameter setting; andauthentication with the printer 103 and parameter setting. In this case,navigation can be made, such as sequential display of messages,“Photograph the QR Code® prepared for an AP” and “Photograph the QRCode® prepared for a printer”, on the display unit 204 of the smartphone101. After photographing of a QR Code®, the smartphone 101 transmits anauthentication request to the printer 103 based on the informationincluded in the QR Code® (F408). At that time, in the process in FIG. 5,which is described below, it is determined whether the authenticationrequest is to be transmitted by unicast, broadcast, or multicast andwhether the authentication request is to be transmitted in a specificchannel or all channels, based on the information included in the QRCode®. The process will be described in detail below. In this example,the authentication request is transmitted from the smartphone 101 to theprinter 103 by unicast in a specific channel indicated by the QR Code®.Since the printer 103 has entered the state of waiting for reception ofan authentication request in the channel, the printer 103 is capable ofreceiving an authentication request transmitted from a peer apparatus atonce. As described above, the authentication request including varioustypes of information based on the information included in the QR Code®is transmitted. When the printer 103 receives the authenticationrequest, the printer 103 compares information included in theauthentication request with the information included in the QR Code®prepared for the printer 103, performs the authentication process, andtransmits the authentication result as an authentication response to thesmartphone 101 (F409).

When the smartphone 101 receives the authentication response transmittedfrom the printer 103, the smartphone 101 analyzes the authenticationresult. When the analysis result indicates authentication success,information for encrypting communication parameters that are to betransferred between the smartphone 101 and the printer 103 can be sharedbetween both of the apparatuses. When necessary, after the smartphone101 receives the authentication response, information necessary forencryption can be transmitted again from the smartphone 101 to theprinter 103.

After the authentication process is performed, thecommunication-parameter setting process is performed between thesmartphone 101 and the printer 103, and communication parameters aretransmitted from the smartphone 101 to the printer 103 (F410). In thecommunication-parameter setting process, information is encrypted in thesmartphone 101 and the printer 103 based on the encrypting informationshared in the authentication process, and the encrypted information iscommunicated. In the present embodiment, an authentication request, anauthentication response, and various messages that arereceived/transmitted in the communication-parameter setting process areimplemented by using an action frame used in a wireless LAN. Assume thatthe printer 103 is also capable of receiving/transmitting an actionframe. The communication parameters transmitted from the smartphone 101to the printer 103 are communication parameters for the wireless network104 constructed by the AP 102.

Upon completion of setting of communication parameters in the printer103, the printer 103 uses the communication parameters transmitted fromthe smartphone 101 to establish a wireless LAN connection to thewireless network 104 (F411). In order to reduce a search time in whichthe printer 103 searches for the AP 102, the communication parametersincluding information for specifying the AP 102 can be transferred fromthe smartphone 101 to the printer 103. As information for specifying theAP 102, the MAC address of the AP 102, channel information of thewireless network 104, a frequency bandwidth that is operating, or thelike can be used. Alternatively, the communication parameters can betransmitted in such a manner that the communication parameters includeinformation for sharing information for specifying both the printer 103and the AP 102, between the apparatuses. The information for specifyingboth of the apparatuses can be information related to the public keys ofboth of the apparatuses which are included in the QR Codes®.

The above-described sequence enables the AP 102 to form the wirelessnetwork 104, and enables the printer 103 to participate in the wirelessnetwork 104.

FIG. 5 is a flowchart of a process performed when the smartphone 101performs the communication-parameter setting process. The flowchart inFIG. 5 starts when a user transmits an instruction to start thecommunication-parameter setting process via the operation unit 203. Theflowchart in FIG. 5 illustrates a process flow performed by thecontroller 206 reading and executing the computer programs stored in thestorage unit 207. Some or all of the steps illustrated in the flowchartin FIG. 5 can be implemented by using hardware such as an applicationspecific integrated circuit (ASIC).

When the smartphone 101 receives an instruction to start thecommunication-parameter setting process, the smartphone 101 photographsa QR Code® by using the image capturing unit 201, decodes thephotographed QR Code®, and obtains the decoded information in S501. Ifthe information obtained from the photographed QR Code® is informationnecessary to set communication parameters, the process proceeds to S502.If information necessary to set communication parameters is not includedin the photographed QR Code®, the smartphone 101 can abnormally end theprocess. In this case, lacking information, format mismatch, and thelike that cause the abnormal end are displayed on the display unit 204,improving visual effects for the user.

In S502, the smartphone 101 transmits an authentication request to thepeer apparatus for which the QR Code® has been photographed. The processof transmitting an authentication request will be described in detailbelow by using FIG. 6. In S502, an authentication request istransmitted. If an authentication response has been received from thepeer apparatus (S503), the smartphone 101 analyzes the authenticationresult included in the authentication response. In S504, if the analysisresult of the authentication result indicates authentication success,the process proceeds to S505. If the analysis result indicatesauthentication failure, the communication-parameter setting process isended. In this case, the cause of the abnormal end is displayed on thedisplay unit 204, improving visual effects for the user.

In S505, the smartphone 101 performs the communication-parameter settingprocess with the peer apparatus. The communication-parameter settingprocess is described above, and no description will be made.

FIG. 6 is a flowchart that illustrates an authentication requesttransmitting process performed in the smartphone 101, and that describesS502 in FIG. 5 in detail. In S601, the smartphone 101 determines whetheridentification information of the target apparatus to whichcommunication parameters are to be set has been obtained. In the presentembodiment, if the QR Code® includes identification information of thesetting target apparatus, the smartphone 101 determines that theidentification information has been obtained. If the QR Code® does notinclude identification information, the smartphone 101 determines thatthe identification information has not been obtained. If theidentification information has been obtained, the process proceeds toS602. If the identification information has not been obtained, theprocess proceeds to S603.

In S602, since the identification information of the target apparatushas been obtained, the smartphone 101 determines that the authenticationrequest is to be transmitted by unicast in which the identificationinformation of the target apparatus is specified as a destination, andthe process proceeds to S604. In contrast, in S603, since theidentification information of the target apparatus has not beenobtained, the smartphone 101 determines that the authentication requestis to be transmitted by broadcast in which a specific apparatus is notspecified as a destination, and the process proceeds to S604.

For example, in the present embodiment, the QR Code® for the printer 103includes identification information for identifying the printer 103.Therefore, the process proceeds to S602, and it is determined that anauthentication request is to be transmitted by unicast. In contrast, inthe present embodiment, the QR Code® for the AP 102 does not includeidentification information for identifying the AP 102. Therefore, it isdetermines that an authentication request is to be transmitted bybroadcast or by multicast in which only multicast group devices arecapable of receiving the authentication request.

In S604, the smartphone 101 determines whether channel information for achannel in which the authentication request is to be transmitted hasbeen obtained. In the present embodiment, if the QR Code® includeschannel information, the smartphone 101 determines that channelinformation used when the authentication request is transmitted to thetarget apparatus has been obtained. If the QR Code® does not includechannel information, the smartphone 101 determines that channelinformation used when the authentication request is transmitted to thetarget apparatus has not been obtained. If channel information has beenobtained, the process proceeds to S605. If channel information has notbeen obtained, the process proceeds to S606.

In S605, since channel information has been obtained, the smartphone 101determines that the authentication request is to be transmitted to thetarget apparatus in a predetermined channel indicated by the obtainedchannel information, and the process proceeds to S607. In contrast, inS606, since channel information has not been obtained, the smartphone101 determines that the authentication request is to be transmitted tothe target apparatus in all channels, and the process proceeds to S607.Transmission in all channels means that an authentication request issequentially transmitted by switching among multiple channels availablefor the smartphone 101.

In S607, the smartphone 101 transmits the authentication request basedon the determinations made in S602, S603, S605, and S606.

In the present embodiment, determination is made depending on whethereach piece of information (identification information of the targetapparatus and channel information) has been obtained from a QR Code®. Aslong as these pieces of information are obtained before transmission ofan authentication request, this is not limited to the example using a QRCode®. For example, another communication method, such as NFC orBluetooth®, can be used to obtain these pieces of information, and itcan be determined whether these pieces of information are present on thebasis of a communication method, such as NFC or Bluetooth®. Similarly,an action frame can be received/transmitted to obtain these pieces ofinformation, and it can be determined whether these pieces ofinformation are present, depending on reception/transmission of anaction frame.

In the present embodiment, the determination processes in S601 and S604are both performed in the authentication request transmitting process inFIG. 6. Alternatively, either one of the determination processes can beperformed. Further, this is not limiting, and another determinationprocess can be performed. For example, determination as to whether thetarget apparatus is connected to the same network can be added. This is,for example, a case in which, when the smartphone 101 photographs the QRCode® prepared for the printer 103, the smartphone 101 and the printer103 have been connected to the wireless network 104 constructed by theAP 102.

Assume that the smartphone 101 can register an apparatus that has beenconnected to the wireless network 104, in the storage unit 207. When thesmartphone 101 photographs the QR Code® prepared for the printer 103 andidentifies the printer 103 from information in the QR Code®, thesmartphone 101 can determine that the printer 103 has been connected tothe AP 102 from the information registered in the storage unit 207. Inthis case, the smartphone 101 can determine that an authenticationrequest is to be transmitted to the printer 103 via the AP 102 in thewireless network 104. In addition, in a state in which channelinformation has been obtained, an authentication request is transmittedin the channel. When it is determined that no responses to theauthentication request are received from the target apparatus, anauthentication request message can be transmitted in all channels again.

In the present embodiment, an authentication request is transmitted in aprocess of searching for the target apparatus. Alternatively, a messagesuch as a probe request based on the IEEE 802.11 standard can betransmitted to perform the search process. In this case, similarly tothe authentication request message, switching between transmission byunicast and transmission by broadcast is made in accordance with whetheridentification information of the target apparatus has been obtained.Similarly, in accordance with whether channel information has beenobtained, switching between transmission in the channel indicated by thechannel information and transmission in all channels is also made. Otherthan a probe request, another frame such as an action frame forsearching for the target communication apparatus can be used.

According to the present embodiment, the smartphone 101 can autonomouslychange the method of searching for a peer apparatus to whichcommunication parameters are to be set, on the basis of whetheridentification information of the peer apparatus has been obtained andwhether channel information has been obtained. This enables thecommunication-parameter setting process to be efficiently performed.

Modified Embodiments

In the above-described embodiment, a QR Code® to be read is not limitedto a QR Code® displayed on a display unit. For example, the QR Code® canbe a QR Code® attached as a label on the case of a communicationapparatus, or a QR Code® attached on an instruction manual or a packagesuch as corrugated cardboard used when the communication apparatus issold. Alternatively, instead of a QR Code®, a bar code or atwo-dimensional code other than a QR Code® can be used. Instead ofmachine-readable information such as a QR Code®, user-readableinformation such as any string can be used. The AP 102 or the printer103 can be provided with a WEB server function, and a QR Code® can bedisplayed on a WEB page.

In the above-described embodiment, the case in which communicationbetween apparatuses is performed through wireless LAN communicationbased on IEEE 802.11 is described. However, this is not limiting. Forexample, a wireless communication medium, such as Wireless USB, MBOA,Bluetooth®, ultra-wideband (UWB), ZigBee, or NFC, can be used to performcommunication. MBOA stands for the Multi Band Orthogonal FrequencyDivision Multiplexing (OFDM) Alliance. Ultra-wideband (UWB) includesWireless USB, Wireless 1394, and WINET.

In the above-described embodiment, the case in which the AP 102 and theprinter 103 are connected to each other in the infrastructure mode of awireless LAN is described. However, this is not limiting. For example,aspects of the present invention can be also applied to a case in whichapparatuses are connected to each other in the ad hoc mode in a wirelessLAN. Instead of the AP 102, a communication apparatus such as a personalcomputer (PC) can be used to connect the PC to the printer 103 by usingWi-Fi Direct®. Further, when the smartphone 101 and the printer 103 areprovided with a connection function using Wi-Fi Direct®, the smartphone101 and the printer 103 can be connected to each other in Wi-Fi Direct®.In this case, after completion of setting of communication parameters,either on of the smartphone 101 and the printer 103 operates as a groupowner in Wi-Fi Direct® which serves as an AP, and constructs a wirelessnetwork by using shared communication parameters. The other one of theapparatuses that is not a group owner is connected to the group owner asa client in Wi-Fi Direct®, whereby a connection in Wi-Fi Direct® can beestablished.

Aspects of the present invention can also be achieved by performing aprocess in which a program for achieving one or more functions accordingto the above-described embodiments is supplied to a system or apparatusover a network or via a storage medium and in which one or moreprocessors in a computer in the system or apparatus read and execute theprogram. Aspects of the present invention can also be achieved by usinga circuit (such as an ASIC) achieving one or more functions.

Other Embodiments

Embodiment(s) of the present invention can also be realized by acomputer of a system or apparatus that reads out and executes computerexecutable instructions (e.g., one or more programs) recorded on astorage medium (which may also be referred to more fully as a‘non-transitory computer-readable storage medium’) to perform thefunctions of one or more of the above-described embodiment(s) and/orthat includes one or more circuits (e.g., application specificintegrated circuit (ASIC)) for performing the functions of one or moreof the above-described embodiment(s), and by a method performed by thecomputer of the system or apparatus by, for example, reading out andexecuting the computer executable instructions from the storage mediumto perform the functions of one or more of the above-describedembodiment(s) and/or controlling the one or more circuits to perform thefunctions of one or more of the above-described embodiment(s). Thecomputer may comprise one or more processors (e.g., central processingunit (CPU), micro processing unit (MPU)) and may include a network ofseparate computers or separate processors to read out and execute thecomputer executable instructions. The computer executable instructionsmay be provided to the computer, for example, from a network or thestorage medium. The storage medium may include, for example, one or moreof a hard disk, a random-access memory (RAM), a read only memory (ROM),a storage of distributed computing systems, an optical disk (such as acompact disc (CD), digital versatile disc (DVD), or Blu-ray Disc (BD)™),a flash memory device, a memory card, and the like.

While aspects of the present invention have been described withreference to exemplary embodiments, it is to be understood that theaspects of the invention are not limited to the disclosed exemplaryembodiments. The scope of the following claims is to be accorded thebroadest interpretation so as to encompass all such modifications andequivalent structures and functions.

This application claims the benefit of Japanese Patent Application No.2015-144401 filed Jul. 21, 2015, which is hereby incorporated byreference herein in its entirety.

What is claimed is:
 1. A communication apparatus comprising: one or moreprocessors; and one or more memories including instructions that, whenexecuted by the one or more processors, cause the apparatus to: acquire,from a captured image, information about a communication-parametersetting process; determine whether the acquired information includesidentification information for identifying another communicationapparatus which executes the communication-parameter setting processwith the communication apparatus; select, based on a result of thedetermination, either transmitting a signal for an authenticationprocess performed in the communication-parameter setting process bybroadcast or unicast, wherein the communication apparatus selects totransmit the signal by broadcast in a case where it is determined thatthe acquired information does not include the identificationinformation, and selects to transmit the signal by unicast in a casewhere it is determined that the acquired information includes theidentification information; and transmit the signal by broadcast in acase where the communication apparatus selects to transmit the signal bybroadcast, and transmit the signal to the another communicationapparatus by unicast based on the identification information in a casewhere the communication apparatus selects to transmit the signal byunicast.
 2. The communication apparatus according to claim 1, whereinthe communication apparatus captures the image.
 3. The communicationapparatus according to claim 1, wherein the captured image is either abar code or a two-dimensional code.
 4. The communication apparatusaccording to claim 1, wherein the communication apparatus provides acommunication parameter to the another communication apparatus in a casewhere the authentication process with the another communicationapparatus is successfully performed.
 5. The communication apparatusaccording to claim 4, wherein the communication parameter is used toperform wireless local-area network communication based on an IEEE802.11 series standard.
 6. The communication apparatus according toclaim 5, wherein the communication parameter is a communicationparameter for an access point in a wireless local-area network in whichthe communication apparatus participates.
 7. A communication method fora communication apparatus comprising: acquiring, from a captured image,information about a communication-parameter setting process; determiningwhether the acquired information includes identification information foridentifying another communication apparatus which executes thecommunication-parameter setting process with the communicationapparatus; and selecting, based on a result of the determination, eithertransmitting a signal for an authentication process performed in thecommunication-parameter setting process by broadcast or unicast, whereinselecting to transmit the signal by broadcast occurs in a case where itis determined that the acquired information does not include theidentification information, and selecting to transmit the signal byunicast occurs in a case where it is determined that the acquiredinformation includes the identification information; and transmitting,the signal by broadcast in a case where the communication apparatusselects to transmit the signal by broadcast, and transmit the signal tothe another communication apparatus by unicast based on theidentification information in a case where the communication apparatusselects to transmit the signal by unicast.
 8. A computer-readablestorage medium storing computer executable instructions for causing acommunication apparatus to perform a process, the process comprising:acquiring, from a captured image, information about acommunication-parameter setting process; determining whether theacquired information includes identification information for identifyinganother communication apparatus which executes thecommunication-parameter setting process with the communicationapparatus; and selecting, based on a result of the determination, eithertransmitting a signal for an authentication process performed in thecommunication-parameter setting process by broadcast or unicast, whereinselecting to transmit the signal by broadcast occurs in a case where itis determined that the acquired information does not include theidentification information, and selecting to transmit the signal byunicast occurs in a case where it is determined that the acquiredinformation includes the identification information; and transmitting,the signal by broadcast in a case where the communication apparatusselects to transmit the signal by broadcast, and transmit the signal tothe another communication apparatus by unicast based on theidentification information in a case where the communication apparatusselects to transmit the signal by unicast.